package com.hdq.config;

import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration
@Slf4j
public class SwaggerConfig {
    /**
     * 生成swagger接口文档
     *
     * @return
     */
    @Bean
    public OpenAPI createOpenApi() {
        Contact contact = new Contact();
        contact.setUrl("https://hdq12.github.io/dqBlog/");
        contact.setName("hdq");
        contact.setEmail("167780695@qq.com");

        Info info = new Info().title("商城管理接口文档")
                .description("商城管理swagger-API管理")
                .version("0.0.1").contact(contact);

        OpenAPI openAPI = new OpenAPI().info(info);
        log.info("开始创建swagger接口文档");
        return openAPI;
    }
}
